﻿using Shop.RemoteModel.ActivityGoods;
using Shop.RemoteModel.ActivityGoods.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class ActivityGoodsEvent : IRpcApiService
    {
        private readonly IActivityGoodsService _Service;

        public ActivityGoodsEvent (IActivityGoodsService service)
        {
            this._Service = service;
        }

        public void DeleteActivityGoods (DeleteActivityGoods obj)
        {
            this._Service.Delete(obj.Id);
        }
        public void BatchDeleteActivityGoods (BatchDeleteActivityGoods obj)
        {
            this._Service.Delete(obj.ActivityId, obj.Ids);
        }
        public void BatchSetActivityGoodsPrice (BatchSetActivityGoodsPrice obj)
        {
            this._Service.SetPrice(obj.ActivityId, obj.Price);
        }
        public ActivityGoodsDto[] GetsActivityGoods (GetsActivityGoods obj)
        {
            return this._Service.Gets(obj.ActivityId);
        }

        public bool SetActivityGoodsPrice (SetActivityGoodsPrice obj)
        {
            return this._Service.SetPrice(obj.Id, obj.Price, obj.IsMust);
        }

        public ActivityGoodsDto[] SetActivityGoods (SetActivityGoods obj)
        {
            return this._Service.Sync(obj.ActivityId, obj.Goods);
        }
    }
}
